<template>
  <div class="assign_permissions">
    <el-dialog v-model="dialogVisible" title="选择成员" width="550" :before-close="handleClose">
      <Power :treeNodeId="rowData.id" :createBy="rowData.createBy" ref="powerNode"/>
      <template #footer>
        <div class="dialog-footer">
          <!-- <el-button @click="dialogVisible = false">Cancel</el-button> -->
          <el-button type="primary" @click="dialogVisible = false"> 关闭 </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
     
<script setup lang='ts'>
import { ref ,nextTick} from 'vue';
import { ElMessageBox } from 'element-plus';
// 自定义组件
import Power from '@/views/enterpriseDoc/component/power/index.vue';
const powerNode = ref(); // usePower组件实例
const dialogVisible = ref(false);
const rowData:any = ref<object>({});
// 打开弹窗
const opne = (row:any) =>{
    rowData.value = row;
    dialogVisible.value = true;
    nextTick(()=>{
        powerNode.value.getTableData()
    })
}

const handleClose = (done: () => void) => {
    dialogVisible.value = false;
};
defineExpose({
    opne,
})
</script>
<style scoped lang='scss'>
.assign_permissions{
    :deep(.el-dialog){
        .el-dialog__header{
            padding-top: 0;
        }
        .el-dialog__body{
            height: 450px;
        }
    }
}
</style>